<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="jt.classic.system.user.IUser"%>
<%@ page import="jt.classic.system.object.IObject"%>
<%@ page import="jt.classic.system.workflow.WObject"%>
<%@ page import="org.limp.mine.annex.AnnexInfo"%>
<%@ page import="org.limp.mine.StringTool"%>
<%@ page import="org.limp.mine.DateTrimmer"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Map"%>
<%
	String context = jt.classic.system.ISystem.getContextPath();

	IObject obj = (IObject)request.getAttribute("object");

    IUser user = jt.classic.system.ISystem.getSessionUser(request);

	WObject wobject = (WObject) request.getAttribute("wobject");
	
	String id = StringTool.checkString(request.getParameter("id"));
	
	String querykey = StringTool.checkString(request.getParameter("querykey"));
	
	Map lxInfo = (Map)((List)obj.icontent(wobject.itable("APP_LX"))).get(0);
	
	String lxtype = (String)lxInfo.get("LXTYPE");
	
	List list = (List)obj.icontent(wobject.itable("APP_LXDTL"));
	
	List list1 = (List)obj.icontent(wobject.itable("APP_XFHANDLER"));
	
	List list2 = (List)obj.icontent(wobject.itable("APP_XFFC"));
	
	List list3 = (List)obj.icontent(wobject.itable("APP_XFFH"));
%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>来信登记</TITLE>
<jsp:include page="../../system/object/initial4view.jsp"></jsp:include>

<link rel="stylesheet" type="text/css"
	href="<%=context%>/app/xf/css/xfstyle.css" />
<script src="<%=context %>/app/xf/js/xfinit.js"></script>
<script>
     function init(){
         initLxdjStyle();
         viewObject();
     }
</script>
</HEAD>
<BODY style="background-color:#fff;" onload="javascript:init();">
<form id="form1" name="form1" method="post"
	enctype="multipart/form-data" action=""><input type="hidden"
	name="lxid" value="" special="none"> <input type="hidden" name="DJRID"
	value="<%=user.id() %>" special="none">  <input type="hidden" name="LXTYPE"
	value="" special="none"> <input type="hidden" name="BLSTATUS"
	value="" special="none"> <input type="hidden" name="SHSTATUS" value="" special="none">
<input type="hidden" name="XF_TYPE_0" value="0" special="none"/> <input type="hidden"
	name="H_STATUS_0" value="0" special="none"/>
<table width="800" align="center">
	<tr>
		<td align="left" height="40"><input style="display:none;" type="button"
			class="button0" name="btn0" value=" 导出(Excel) "
			onclick="javascript:handleSave();"> <input type="button"
			class="button0" name="btn1" value=" 关闭窗口 "
			onclick="javascript:window.close();"></td>
	</tr>
</table>	
<table width="800" class="tab4edit" border="1" cellspacing="0"
	cellpadding="0" align="center">
	<tr>
		<td align="center" height="40" colspan="4" class="tdtlt">(<%=(lxtype.equals("0")?"街乡":"区") %>)来信登记单</td>
	</tr>
	<tr>
		<td class="td0" width="150" align="right"></td>
		<td width="250"></td>
		<td class="td0" width="150" align="right">督办类型</td>
		<td width="250"><input
			type="hidden" name="DBLXNAME" value=""></td>
	</tr>
	<tr>
		<td class="td0" align="right">国家内容分类 </td>
		<td> <input
			type="text" name="GJNRNAME" readonly value=""></td>
		<td class="td0" align="right">性质分类 </td>
		<td><input type="text" readonly name="XZNAME" value=""></td>
	</tr>
	<tr>
		<td class="td0" align="right">内容分类 </td>
		<td><input type="text" readonly name="NRNAME" value=""> 
		</td>
		<td class="td0" align="right">信访问题分类 </td>
		<td><input
			type="text" readonly name="XFWTNAME" value=""> </td>
	</tr>
	<tr>
		<td class="td0" align="right">转送方式 </td>
		<td><input type="hidden" name="ZSFSID" value=""
			special="wordbook" wbtype="xf_zsfs" wbname="ZSFSNAME" colneed="1" label="转送方式"> </td>
		<td class="td0" align="right">是否区立案</td>
		<td>是 <input type="radio" name="LA" id="LA01"
			value="1" /> 否 <input type="radio" name="LA" id="LA02" value="0"
			checked /></td>
	</tr>
	<tr>
		<td class="td0" align="right">来信类型 </td>
		<td><input type="hidden" name="LXLXID" value=""
			special="wordbook" wbtype="xf_cllx" wbname="LXLXNAME"> </td>
		<td class="td0" align="right">受信人或单位 </td>
		<td><input type="text" name="SXRDW" id="SXRDW" colneed="1" label="受信人或单位"/></td>
	</tr>
	<tr>
		<td class="td0" align="right">上级单位</td>
		<td><input type="text" name="SJDW" id="SJDW" /></td>
		<td class="td0" align="right">上级编号</td>
		<td><input type="text" name="SJBH" id="SJBH" /></td>
	</tr>
	<tr>
		<td class="td0" align="right">原始单位</td>
		<td><input type="text" name="YSDW" id="YSDW" /></td>
		<td class="td0" align="right">原始单位编号</td>
		<td><input type="text" name="YSDWBH" id="YSDWBH" /></td>
	</tr>
	<tr>
		<td class="td0" align="right">身份</td>
		<td><input type="hidden" name="SF" value="" special="wordbook"
			wbtype="xf_sf" wbname="SFNAME"> <input type="hidden"
			name="SFNAME" value=""></td>
		<td class="td0" align="right">信访原因</td>
		<td><input type="hidden" name="XFYYID" value=""
			special="wordbook" wbtype="xf_yy" wbname="XFYYNAME"> <input
			type="hidden" name="XFYYNAME" value=""></td>
	</tr>
	<tr>
		<td class="td0" align="right">人数 </td>
		<td><input type="text" name="RS" id="RS" value="1" onkeyup="value=value.replace(/[^\d]/g,'')" colneed="1" label="人数"/></td>
		<td class="td0" align="right">所属地 </td>
		<td><input type="text" name="SSDNAME" value=""></td>
	</tr>
	<tr>
		<td class="td0" align="right">信息来源 </td>
		<td><input
			type="hidden" name="XXLYNAME" value=""></td>
		<td class="td0" align="right">条形码编号</td>
		<td><input type="text" name="TXM" id="TXM" /></td>
	</tr>
	<tr>
		<td class="td0" align="right">是否重复反映</td>
		<td><label>首次反映 <input type="radio" name="SFCF"
			id="SFCF01" value="0" checked /> 重复反映 <input type="radio" name="SFCF"
			id="SFCF02" value="1" /><br />
		一信多投 <input type="radio" name="SFCF" id="SFCF03" value="2" /> </label></td>
		<td class="td0" align="right">被反映单位</td>
		<td><input type="text" name="BFYDW" id="BFYDW" /></td>
	</tr>
	<tr>
		<td class="td0" align="right">来信日期 </td>
		<td><input type="hidden" name="XFTIME" special="date" value="<%=DateTrimmer.getYMD() %>" colneed="1" label="来信日期"></td>
		<td class="td0" align="right">信息重要程度</td>
		<td><input
			type="hidden" name="ZYCDNAME" value=""></td>
	</tr>
	<tr>
		<td class="td0" align="right">登记人</td>
		<td><%=user.iname()%></td>
		<td class="td0" align="right">限结日期</td>
		<td><input type="hidden" name="XJTIME" value="" special="date"/></td>
	</tr>
	<tr>
		<td class="td0" valign="middle" align="right">内容  </td>
		<td colspan="3"><textarea name="NR" id="NR" cols="30" rows="5" colneed="1" label="内容"></textarea></td>
	</tr>
	<tr>
		<td class="td0" valign="middle" align="right">关键字</td>
		<td colspan="3"><textarea name="GJZ" id="GJZ" cols="30" rows="5"></textarea></td>
	</tr>
	<tr>
		<td class="td0" align="right">原信</td>
		<td colspan="3"><input type="file" name="YX" id="YX" />
	</tr>
	<tr align="right" valign="middle">
		<td class="td0">处理方式 </td>
		<td colspan="3" align="left"><textarea name="CLFS" cols="80" rows="3" colneed="1" label="处理方式"></textarea> 
		</td>
	</tr>
	<tr align="right" valign="middle" >
		<td class="td0">领导批示</td>
		<td colspan="3" align="left"><textarea name="LDPS" cols="80" rows="3"></textarea></td>
	</tr>

	<tr align="right" valign="middle">
		<td class="td0">领导批示件</td>
		<td colspan="3" align="left"><input type="file" name="LDPSJ" id="LDPSJ" />
		</td>
	</tr>

	<tr align="right" valign="middle">
		<td class="td0">交 办 单</td>
		<td colspan="3" align="left"><input type="file" name="JBD" id="JBD"/>
		</td>
	</tr>
	<tr>
		<td colspan="4" class="tdtlt">
		<div align="center">来信人登记</div>
		</td>
	</tr>
	<tr>
		<td colspan="4" class="nopadding">
		<table border="1" class="tab-noborder" id="lxr" width="100%"
			cellspacing="0" cellpadding="0">
			<tr>
				<td class="td0" style="border:0px;">来信人姓名</td>
				<td class="td0" style="border:0px;">性别</td>
				<td class="td0" style="border:0px;">年龄</td>
				<td class="td0" style="border:0px;">身份证号</td>
				<td class="td0" style="border:0px;">联系电话</td>
				<td class="td0" style="border:0px;">邮政编码</td>
				<td class="td0" style="border:0px;">单位或地址</td>
			</tr>
			<%
					if (list != null && !list.isEmpty()) {
					for (int i = 0; i < list.size(); i++) {
						
			%>
			<tr>
				<td style="border:0px;"><input type="hidden"
					name="lxdtid_<%=i %>" id="lxdtid_<%=i %>" special="none"/> <input
					type="hidden" name="lxid_<%=i %>" id="lxid_<%=i %>" special="none" /><input
					type="text" name="XF_USERNAME_<%=i %>" id="XF_USERNAME_<%=i %>" /></td>
				<td style="border:0px;"><select name="XF_USERSEX_<%=i %>"
					id="XF_USERSEX_<%=i %>">
					<option value="1">男</option>
					<option value="0">女</option>
				</select></td>
				<td style="border:0px;"><input type="text"
					name="XF_USERAGE_<%=i %>" id="XF_USERAGE_<%=i %>" /></td>
				<td style="border:0px;"><input type="text"
					name="XF_USERLICENSE_<%=i %>" id="XF_USERLICENSE_<%=i %>" /></td>
				<td style="border:0px;"><input type="text"
					name="XF_USERTEL_<%=i %>" id="XF_USERTEL_<%=i %>" /></td>
				<td style="border:0px;"><input type="text"
					name="XF_USERCODE_<%=i %>" id="XF_USERCODE_<%=i %>" /></td>
				<td style="border:0px;"><input type="text"
					name="XF_USERADDRESS_<%=i %>" id="XF_USERADDRESS_<%=i %>" /></td>
			</tr>
			<%
				}
				}
			%>
		</table>
	</td>
	</tr>
</table>

		<%
		if (list1 != null && !list1.isEmpty()) {
				for (int i = 0; i < list1.size(); i++) {
					Map info = (Map)list1.get(i);
					
					String hdlstatus = (String)info.get("H_STATUS");
					if(hdlstatus.equals("1")){
		%>
		<table border="1" class="tab-noborder" style="margin-top:5px;" width="800" cellspacing="0" cellpadding="0" align="center">		
		<tr>
			<td style="border:0px;" colspan="2"><b>办理人：</b><%=info.get("H_USERNAME") %>，<b>所在科室：</b><%=info.get("H_GROUPNAME") %>，<b>办理时间：</b><%=DateTrimmer.getYMD_LBL((String)info.get("H_DATE")) %></td>
		</tr>
		<tr>
			<td style="border:0px;" width="10%" valign="top"><b>回复内容：<b></td>
			<td style="border:0px;" align="left"><%=info.get("H_BACKINFO") %></td>
		</tr>
		</table>
		<%
			  
					}
				}	
			}
		%>
		
<%
if (list2 != null && !list2.isEmpty()) {
		for (int i = 0; i < list2.size(); i++) {
			Map info = (Map)list2.get(i);
			
			String hdlstatus = (String)info.get("FC_STATUS");
			if(hdlstatus.equals("1")){
				AnnexInfo ai = (AnnexInfo)info.get("FC_FILE");
%>
<table border="1" class="tab-noborder" style="margin-top:5px;" width="800" cellspacing="0" cellpadding="0" align="center">		
<tr>
	<td style="border:0px;" colspan="2"><b>复查办理人：</b><%=info.get("FC_USERNAME") %>，<b>科室：</b><%=info.get("FC_GROUPNAME") %>，<b>复查办理时间：</b><%=DateTrimmer.getYMD_LBL((String)info.get("FC_BLDATE")) %></td>
</tr>
<tr>
	<td style="border:0px;" width="15%" valign="top"><b>复查办理内容：<b></td>
	<td style="border:0px;" align="left"><%=info.get("FC_BACKINFO") %></td>
</tr>
<%if(ai != null){ %>
<tr>
	<td style="border:0px;" width="15%" valign="top"><b>附件：<b></td>
	<td style="border:0px;" align="left"><a href="javascript:void(0);" onclick="javascript:viewAnnex('<%=ai.getID()%>');" title="查看附件"><%=ai.getName()%></a></td>
</tr>
<%} %>
</table>
<%
	  
			}
		}	
	}
%>

<%
if (list3 != null && !list3.isEmpty()) {
		for (int i = 0; i < list3.size(); i++) {
			Map info = (Map)list3.get(i);
			
			String hdlstatus = (String)info.get("FH_STATUS");
			if(hdlstatus.equals("1")){
				AnnexInfo ai = (AnnexInfo)info.get("FH_FILE");
%>
<table border="1" class="tab-noborder" style="margin-top:5px;" width="800" cellspacing="0" cellpadding="0" align="center">		
<tr>
	<td style="border:0px;" colspan="2"><b>复核办理人：</b><%=info.get("FH_USERNAME") %>，<b>科室：</b><%=info.get("FH_GROUPNAME") %>，<b>复核办理时间：</b><%=DateTrimmer.getYMD_LBL((String)info.get("FH_BLDATE")) %></td>
</tr>
<tr>
	<td style="border:0px;" width="15%" valign="top"><b>复核办理内容：<b></td>
	<td style="border:0px;" align="left"><%=info.get("FH_BACKINFO") %></td>
</tr>
<%if(ai != null){ %>
<tr>
	<td style="border:0px;" width="15%" valign="top"><b>附件：<b></td>
	<td style="border:0px;" align="left"><a href="javascript:void(0);" onclick="javascript:viewAnnex('<%=ai.getID()%>');" title="查看附件"><%=ai.getName()%></a></td>
</tr>
<%} %>
</table>
<%
	  
			}
		}	
	}
%>
	
<div>&nbsp;</div>
</form>
</BODY>
</HTML>
